ngs The settings.
*
* @return array The settings.
*/
protected function get_disabled_settings( $settings ) {
$disabled_settings = [];
foreach ( WPSEO_Options::$options as $option_name => $instance ) {
if ( ! \in_array( $option_name, self::ALLOWED_OPTION_GROUPS, true ) ) {
continue;
}
$disabled_settings[ $option_name ] = [];
$option_instance = WPSEO_Options::get_option_instance( $option_name );
if ( $option_instance === false ) {
continue;
}
foreach ( $settings[ $option_name ] as $setting_name => $setting_value ) {
if ( $option_instance->is_disabled( $setting_name ) ) {
$disabled_settings[ $option_name ][ $setting_name ] = 'network';
}
}
}
// Remove disabled on multisite settings.
if ( \is_multisite() ) {
foreach ( self::DISABLED_ON_MULTISITE_SETTINGS as $option_name => $disabled_ms_settings ) {
if ( \array_key_exists( $option_name, $disabled_settings ) ) {
foreach ( $disabled_ms_settings as $disabled_ms_setting ) {
$disabled_settings[ $option_name ][ $disabled_ms_setting ] = 'multisite';
}
}
}
}
return $disabled_settings;
}
/**
* Retrieves the replacement variables.
*
* @return array The replacement variables.
*/
protected function get_replacement_variables() {
$recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars();
$specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars();
$replacement_variables = $this->replace_vars->get_replacement_variables_with_labels();
return [
'variables' => $replacement_variables,
'recommended' => $recommended_replace_vars->get_recommended_replacevars(),
'specific' => $specific_replace_vars->get(),
'shared' => $specific_replace_vars->get_generic( $replacement_variables ),
];
}
/**
* Retrieves the schema.
*
* @param array $post_types The post types.
*
* @return array The schema.
*/
protected function get_schema( array $post_types ) {
$schema = [];
foreach ( $this->schema_types->get_article_type_options() as $article_type ) {
$schema['articleTypes'][ $article_type['value'] ] = [
'label' => $article_type['name'],
'value' => $article_type['value'],
];
}
foreach ( $this->schema_types->get_page_type_options() as $page_type ) {
$schema['pageTypes'][ $page_type['value'] ] = [
'label' => $page_type['name'],
'value' => $page_type['value'],
];
}
$schema['articleTypeDefaults'] = [];
$schema['pageTypeDefaults'] = [];
foreach ( $post_types as $name => $post_type ) {
$schema['articleTypeDefaults'][ $name ] = WPSEO_Options::get_default( 'wpseo_titles', "schema-article-type-$name" );
$schema['pageTypeDefaults'][ $name ] = WPSEO_Options::get_default( 'wpseo_titles', "schema-page-type-$name" );
}
return $schema;
}
/**
* Transforms the post types, to represent them.
*
* @param WP_Post_Type[] $post_types The WP_Post_Type array to transform.
*
* @return array The post types.
*/
protected function transform_post_types( $post_types ) {
$transformed = [];
foreach ( $post_types as $name => $post_type ) {
$transformed[ $name ] = [
'name' => $post_type->name,
'route' => $this->get_route( $post_type->name, $post_type->rewrite, $post_type->rest_base ),
'label' => $post_type->label,
'singularLabel' => $post_type->labels->singular_name,
'hasArchive' => $this->post_type_helper->has_archive( $post_type ),
'hasSchemaArticleType' => $this->article_helper->is_article_post_type( $post_type->name ),
'menuPosition' => $post_type->menu_position,
];
}
\uasort( $transformed, [ $this, 'compare_post_types' ] );
return $transformed;
}
/**
* Compares two post types.
*
* @param array $a The first post type.
* @param array $b The second post type.
*
* @return int The order.
*/
protected function compare_post_types( $a, $b ) {
if ( $a['menuPosition'] === null && $b['menuPosition'] !== null ) {
return 1;
}
if ( $a['menuPosition'] !== null && $b['menuPosition'] === null ) {
return -1;
}
if ( $a['menuPosition'] === null && $b['menuPosition'] === null ) {
// No position specified, order alphabetically by label.
return \strnatcmp( $a['label'], $b['label'] );
}
return ( ( $a['menuPosition'] < $b['menuPosition'] ) ? -1 : 1 );
}
/**
* Transforms the taxonomies, to represent them.
*
* @param WP_Taxonomy[] $taxonomies The WP_Taxonomy array to transform.
* @param string[] $post_type_names The post type names.
*
* @return array The taxonomies.
*/
protected function transform_taxonomies( $taxonomies, $post_type_names ) {
$transformed = [];
foreach ( $taxonomies as $name => $taxonomy ) {
$transformed[ $name ] = [
'name' => $taxonomy->name,
'route' => $this->get_route( $taxonomy->name, $taxonomy->rewrite, $taxonomy->rest_base ),
'label' => $taxonomy->label,
'singularLabel' => $taxonomy->labels->singular_name,
'postTypes' => \array_filter(
$taxonomy->object_type,
static function ( $object_type ) use ( $post_type_names ) {
return \in_array( $object_type, $post_type_names, true );
}
),
];
}
\uasort(
$transformed,
static function ( $a, $b ) {
return \strnatcmp( $a['label'], $b['label'] );
}
);
return $transformed;
}
/**
* Gets the route from a name, rewrite and rest_base.
*
* @param string $name The name.
* @param array $rewrite The rewrite data.
* @param string $rest_base The rest base.
*
* @return string The route.
*/
protected function get_route( $name, $rewrite, $rest_base ) {
$route = $name;
if ( isset( $rewrite['slug'] ) ) {
$route = $rewrite['slug'];
}
if ( ! empty( $rest_base ) ) {
$route = $rest_base;
}
// Always strip leading slashes.
while ( \substr( $route, 0, 1 ) === '/' ) {
$route = \substr( $route, 1 );
}
return $route;
}
/**
* Retrieves the fallbacks.
*
* @return array The fallbacks.
*/
protected function get_fallbacks() {
$site_logo_id = \get_option( 'site_logo' );
if ( ! $site_logo_id ) {
$site_logo_id = \get_theme_mod( 'custom_logo' );
}
if ( ! $site_logo_id ) {
$site_logo_id = '0';
}
return [
'siteLogoId' => $site_logo_id,
];
}
}
Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/core-se.org.br/web/wp-content/plugins/wordpress-seo/src/integrations/settings-integration.php:1) in /var/www/html/core-se.org.br/web/wp-includes/rest-api/class-wp-rest-server.php on line 1752
Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/core-se.org.br/web/wp-content/plugins/wordpress-seo/src/integrations/settings-integration.php:1) in /var/www/html/core-se.org.br/web/wp-includes/rest-api/class-wp-rest-server.php on line 1752
Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/core-se.org.br/web/wp-content/plugins/wordpress-seo/src/integrations/settings-integration.php:1) in /var/www/html/core-se.org.br/web/wp-includes/rest-api/class-wp-rest-server.php on line 1752
Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/core-se.org.br/web/wp-content/plugins/wordpress-seo/src/integrations/settings-integration.php:1) in /var/www/html/core-se.org.br/web/wp-includes/rest-api/class-wp-rest-server.php on line 1752
Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/core-se.org.br/web/wp-content/plugins/wordpress-seo/src/integrations/settings-integration.php:1) in /var/www/html/core-se.org.br/web/wp-includes/rest-api/class-wp-rest-server.php on line 1752
Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/core-se.org.br/web/wp-content/plugins/wordpress-seo/src/integrations/settings-integration.php:1) in /var/www/html/core-se.org.br/web/wp-includes/rest-api/class-wp-rest-server.php on line 1752
{"code":"rest_no_route","message":"Nenhuma rota foi encontrada que corresponde com o URL e o m\u00e9todo de requisi\u00e7\u00e3o.","data":{"status":404}}